//
//  ThemeProtocol.swift
//  主题切换
//
//  Created by 王帅强 on 2019/1/14.
//  Copyright © 2019 王帅强. All rights reserved.
//

import UIKit

/// 面向接口(协议)  所有的theme 都要遵守协议
protocol ThemeProtocol {
    var backgroundColor: UIColor {get}
    var titleTextColor: UIColor {get}
    var subTitleTextColor: UIColor {get}
}



/// 定义协议枚举类型
enum ThemeType {
    case whiteTheme
    case blackTheme
    case redTheme

    var theme: ThemeProtocol {
        get {
            switch self {
            case .whiteTheme:
                return WhiteTheme()
            case .blackTheme:
                return BlackTheme()
            case .redTheme:
                return RedTheme()

            }
        }
    }
}
